using System;
using System.Collections.Generic;
using System.Text;

namespace SpoonCore2.Tools
{
	public sealed class ColorConsole
	{
		private static readonly Object _lock = new object();

		private ColorConsole()
		{ }

		public static int LargestWindowWidth
		{
			get { return Console.LargestWindowWidth; }
		}

		public static int LargestWindowHeight
		{
			get { return Console.LargestWindowHeight; }
		}

		public static void WriteLine(string text)
		{
			lock (_lock)
				Console.WriteLine(text);

		}

		public static void WriteLine(string text, ConsoleColor color)
		{
			lock (_lock)
			{
				ConsoleColor old = Console.ForegroundColor;
				Console.ForegroundColor = color;
				Console.WriteLine(text);
				Console.ForegroundColor = old;
			}
		}

		public static void SetWindowSize(int x, int y)
		{
			Console.SetWindowSize(x, y);
		}

		public static void WriteLine(object o)
		{
			lock (_lock)
				Console.WriteLine(o);

		}

		public static string ReadLine()
		{
			return Console.ReadLine();
		}

		public static void WriteLine()
		{
			lock (_lock)
				Console.WriteLine();
		}
	}
}
